package com.example.treasure_back.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.treasure_back.entity.MsgEntity;
import com.example.treasure_back.mapper.GoodsMapper;
import com.example.treasure_back.model.GoodsModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/treasure/goods")
public class GoodsController {

    @Autowired
    private GoodsMapper goodsMapper;

    @RequestMapping("/getAllGoods")
    public MsgEntity getAllGoods(){
        QueryWrapper<GoodsModel> objectQueryWrapper = new QueryWrapper<>();
        List<GoodsModel> goodsList = goodsMapper.selectList(objectQueryWrapper);
        return new MsgEntity("SUCCESS","200",goodsList);
    }
}
